package com.lanhe.app.controller.order;

import com.alibaba.fastjson2.JSON;
import com.lanhe.common.core.controller.BaseController;
import com.lanhe.common.core.page.TableDataInfo;
import com.lanhe.order.domain.LhOrdersDuoyou;
import com.lanhe.order.domain.dto.LhOrdersDuoyouDto;
import com.lanhe.order.service.ILhOrdersDuoyouService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


/**
 * (LhOrdersDuoyou)表控制层
 *
 * @author zhanggl
 * @since 2023-12-11 09:58:47
 */
@RestController
@RequestMapping("/api/duoyou/orders")
@Slf4j
public class ApiLhOrdersDuoyouController extends BaseController {

	/**
	 * 服务对象
	 */
	@Resource
	private ILhOrdersDuoyouService lhOrdersDuoyouService;

	/**
	 * 新增数据
	 *
	 * @param ordersDuoyou 实体对象
	 * @return 新增结果
	 */
	@GetMapping("/add")
	public Object add(LhOrdersDuoyouDto ordersDuoyou) throws Exception {

		log.info("ApiLhOrdersDuoyouController--->add 多游收回调条件接收：【{}】", JSON.toJSONString(ordersDuoyou));
		lhOrdersDuoyouService.insertOrdersDuoyou(ordersDuoyou);
		return toAjaxDuoyou(200);
	}


	/**
	 * 分页查询所有数据
	 */
	@GetMapping("/list")
	public TableDataInfo list(LhOrdersDuoyou ordersHaoka) {
		startPage();
		ordersHaoka.setMemberId(getUserId());
		List<LhOrdersDuoyou> list = lhOrdersDuoyouService.selectOrdersList(ordersHaoka);
		return getDataTable(list);
	}
}

